package com.cmcc.groupcontacts.firewall.dao;

import com.cmcc.groupcontacts.firewall.dao.model.BaseModel;
import com.cmcc.groupcontacts.firewall.dao.model.KeywordsVO;

/**
 * 信息拦截关键字DAO
 * 
 * @author 
 *
 */
public class KeywordsDAO extends BaseDAO<KeywordsVO> {
	public static String TABLE_NAME = "keywords";

	public KeywordsDAO() {
		super(TABLE_NAME);
	}

	@Override
	protected KeywordsVO getInstance() {
		return new KeywordsVO();
	}

	@Override
	protected String[] getBeanAllCols() {
		return KeywordsVO.MetaData.ALL_COLS;
	}

	@Override
	protected void afterGetColValue(BaseModel bean, String colName, String value) {
		KeywordsVO keywords = (KeywordsVO) bean;
		if (KeywordsVO.MetaData.ID.equals(colName))
			keywords.setId(Integer.valueOf(value));
		else if (KeywordsVO.MetaData.KEYWORDS.equals(colName))
			keywords.setKeywords(value);
	}
}
